package com.nowcoder.community.dao;/**
 * @description:
 * @Author HP
 * @create 2021/12/14 15:41
 */

import com.nowcoder.community.entity.LoginTicket;
import org.apache.ibatis.annotations.*;

/**
 * @author HP
 * @create 2021-12-14 15:41
 * @desc loginticket的mapper
 **/
@Mapper
@Deprecated
public interface LoginTicketMapper {
    @Insert({
            "insert into login_ticket(user_id,ticket,status,expired) ",
            "values(#{userId},#{ticket},#{status},#{expired})"
    })
    @Options(useGeneratedKeys = true,keyProperty = "id")
    int insertLoginTicket(LoginTicket loginTicket);

    @Select({
            "select user_id,ticket,status,expired ",
            "from login_ticket ",
            "where ticket=#{ticket}"
    })
    LoginTicket selectByTicket(String ticket);

    @Update({
            "update login_ticket ",
            "set status=#{status} where ticket=#{ticket}"
    })
    int updateStatus(String ticket,int status);
}
